package com.scau.database.controller.admin;

import com.scau.data.entity.WareHouseDO;
import com.scau.database.service.admin.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: x1aolone
 * @Date: 2020/5/9 17:55
 */
@RestController
@RequestMapping("/api/admin")
public class WarehouseController {

    @Autowired
    public WarehouseService warehouseService;

    @GetMapping("/getWarehouse")
    public List<WareHouseDO> getWarehouse () {
        return warehouseService.echo();
    }

    @PostMapping("/addWarehouse")
    public Integer addWarehouse (@RequestBody WareHouseDO DO) {
        return warehouseService.addWarehouse(DO);
    }

}
